package com.cvte.sunkit.ui.base

import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import com.cvte.sunkit.utils.ActivityCollector
import com.gyf.immersionbar.ImmersionBar

/**
 * 项目基类
 */
abstract class BaseActivity : AppCompatActivity() {

    companion object {
        private const val TAG = "BaseActivity"
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        Log.d(TAG, javaClass.simpleName)
        ActivityCollector.addActivity(this)
        ImmersionBar.with(this).apply {
            transparentStatusBar()
            statusBarDarkFont(true)
            fitsSystemWindows(false)
            init()
        }
    }

    override fun onDestroy() {
        super.onDestroy()
        ActivityCollector.removeActivity(this)
    }
}